#!/bin/bash
#2020年6月16日10:33:13
#by author jfedu.net
#auto install apache and vhosts
##################
wget -c http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.25.tar.bz2
wget -c http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.bz2
wget -c http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.bz2
#Install apr for apache for
tar -jxvf apr-1.5.2.tar.bz2
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make
make install

#Install apr-util for apache for
cd ..
tar -jxvf apr-util-1.5.4.tar.bz2 
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make
make install

#Install apache 
cd ..
tar -jxvf httpd-2.4.25.tar.bz2
cd httpd-2.4.25
./configure --prefix=/usr/local/apache2/ --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make
make install
pkill httpd
pkill nginx
/usr/local/apache2/bin/apachectl start
